import { FC, useEffect } from 'react';
import SimpleList from '@/components/SimpleList';
import { useModel } from 'umi';
const columns: any[] = [
  {
    title: '软件全称',
    dataIndex: 'V001',
    width: 120,
  },
  {
    title: '软件简称',
    dataIndex: 'V002',
    width: 120,
  },
  {
    title: '版本号',
    dataIndex: 'V003',
    width: 110,
  },
  {
    title: '软件分类',
    dataIndex: 'V004',
    width: 140,
  },
  {
    title: '持有企业',
    dataIndex: 'V005',
    width: 95,
  },
  {
    title: '首次发表日期',
    dataIndex: 'V006',
    width: 150,
  },
  {
    title: '登记日期',
    dataIndex: 'V007',
    width: 128,
  },
];

const SoftwareCopyright: FC = () => {
  const { software, getSoftware } = useModel('company');
  useEffect(() => {
    const id = window.sessionStorage.getItem('companyId') || '';
    getSoftware({ id });
  }, []);
  return (
    <SimpleList
      width={848}
      height={220}
      columns={columns}
      dataSource={software}
      headerStyle={{
        height: 42,
        backgroundColor: 'rgba(141, 141, 141, 0.1)',
      }}
      rowStyle={{
        height: 42,
      }}
      sortStyle={{
        width: 88,
      }}
      hover
      odd
      rowBackground
    />
  );
};
export default SoftwareCopyright;
